const { Schema, model } = require('mongoose');

const ordersSchema = new Schema({
    startTime: String,
    state: {
        type: Number,
        default: 1
    },
    delete: {
        type: Boolean,
        default: false
    },
    endTime: String,
    // 关联租客集合
    tenantsId: {
        type: Schema.Types.ObjectId,
        ref: "tenantsModel"
    },
    //关联车位集合
    parkingsId: {
        type: Schema.Types.ObjectId,
        ref: "parkingsModel"
    }

}, { versionKey: false })

const ordersModel = model('ordersModel', ordersSchema, 'orders');
module.exports.ordersModel = ordersModel;